<template>
  <div class="addNote">
    <el-form ref="form" :model="formInline" label-width="100px" class="custom-form">
      <el-form-item label="备注">
        <el-input class="custom-input" v-model="formInline.note" placeholder="请输入备注"></el-input>
      </el-form-item>
      <el-form-item label>
        <el-button @click="$emit('closeDialog')">取消</el-button>
        <el-button type="primary" @click="sure">确定</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
  
  <script>
import { addNote } from "@/api/businessUser/moneyManagment";
export default {
  name: "addNote",
  props: {
    row: {
      type: Object,
      default: {}
    }
  },
  data() {
    return {
      formInline: {
        note: "",
        yund_id: ""
      },
    };
  },
  mounted() {
    this.formInline.note = this.row.beizhu;
    this.formInline.yund_id = this.row.yund_id;
    this.initial();
  },
  methods: {
    async initial() {
      this.formInline.note = this.row.beizhu;
      this.formInline.yund_id = this.row.yund_id;
    },
    async sure() {
      console.log("this.formInline", this.formInline);
      if (this.formInline.note === "") {
        this.$message.error("备注不能为空!");
        return;
      }
      let result = await addNote(this.formInline);
      if (result.code == 200) {
        this.$message.success("添加成功");
        setTimeout(() => {
          this.$emit("sureDialog");
        }, 500);
      }
    }
  }
};
</script>
  
  <style lang="scss" scoped>
.addNote {
}
</style>
  
  